Skip to content

fix(test): hold frame messages back in the capture phase, as the runtime now listens - #573

Merged
kgoedecke merged 1 commit into
mainfrom
kgoedecke/fix-context-menu-delay-hook
Nov 21, 2026
Merged

kgoedecke merged 1 commit into
mainfrom
kgoedecke/fix-context-menu-delay-hook

Conversation

@kgoedecke

Copy link
Copy Markdown
Collaborator

main has been red since #570: elementContextMenuBrowser.test.ts > waits for the matching iframe document before using a position-based selector fails on every run.

#570 moved the frame runtime's message listener to the capture phase and made it ignore untrusted events. The test's delay hook was a bubble-phase listener that re-dispatched a synthetic MessageEvent, so it no longer held doop:html back and its release was ignored.

The hook now intercepts in the capture phase (registered before the runtime, so it runs first), and a message held inside the frame is released by the editor page posting it again (releaseFrameMessage), a trusted message from the parent as the runtime requires. The parent-side hold used by the doop:context-hit test is unchanged.

Verified locally: the old test fails on main, all 16 pass with this change.

🤖 Generated with Claude Code

…ime now listens

#570 moved the frame runtime's message listener to the capture phase and made
it ignore untrusted events, so the context-menu test's delay hook neither held
doop:html back nor could re-dispatch it. Intercept in the capture phase and
release by posting the held message again from the editor page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The change is confined to one browser-test workflow.

The PR appears safe to merge, with a non-blocking gap in the dismissed-menu test.

Findings

  1. P2 Late hits go untested ▶

Summary

Repairs the delayed HTML test by catching messages in the capture phase and posting held messages again from the editor page.

  • The browser test pauses iframe updates and resumes them through the editor page.

Reviews (1) · Last reviewed commit: "fix(test): hold frame messages back in t..." · Reviewed by Greptile

Comment on lines +103 to +105
if (window !== window.parent) {
window.heldFrameMessage = event.data
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Late hits go untested

The iframe branch now stores doop:context-hit in heldFrameMessage without setting releaseContextMessage. The dismissed-menu test still calls doc.evaluate(() => window.releaseContextMessage?.()), so its release does nothing. The test can pass without checking whether the old hit changes the second menu. Update that test to wait for the held message and call releaseFrameMessage().

@kgoedecke
kgoedecke merged commit 14b2906 into main Nov 21, 2026
11 checks passed
@kgoedecke
kgoedecke deleted the kgoedecke/fix-context-menu-delay-hook branch November 21, 2026 10:04
ttalks-dev pushed a commit to ttalks-dev/doop that referenced this pull request Nov 23, 2026
…omponents (doop-design#573)

* feat(agents): set up a component system before screens, with create_components

Agents built screens without components: the guide only asked for one after a third
copy, and the reuse notes spoke at the end of a write.

- The guide opens with a must-do list: tokens, then a component system set up the way a
  designer sets up a Figma file, then screens composed from it; themes are tokens.
- The brief creates the kit; COMPONENTS asks for components by judgment, from the first copy.
- create_frame, append_frame_html and set_frame_html (and the resident's tools) ask for
  the check in their descriptions.
- create_components makes up to 12 components in one call, in order, each its own unit.
- COMPONENT SYSTEM notes: an empty create_frame hears to set up or use the system; a
  screen written without components hears what it skipped, once per stream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(agents): refuse a create_components entry that nests a missing component

A <doop-use> naming nothing renders as nothing, so a Card nesting a Button the same
call refused was saved without its button for good. Each entry now runs in its own
savepoint and is refused when its main reports an unknown component; the others go on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit deb965e49246c34a5b4dfc8970f43fbdc6309b26)
ttalks-dev pushed a commit to ttalks-dev/doop that referenced this pull request Nov 23, 2026
The rebase onto main brought doop-design#573's system-first section and doop-design#566's
inspect_frame paragraph into the main guide. Drop the old "third time"
component rule that doop-design#573 replaced, and raise the main guide's budget
to 30,000 characters for what main added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant